#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
int main()
{

  pid_t id =fork();
if(id==0)
{
  while(1)
  {
    printf("我是子进程 pid:%d ppid%d\n",getpid(),getppid());
  }
}
else
{
  int cin=5;
while(1)
{
  printf("我是父进程pid:%d ,ppid:%d\n",getpid(),getppid());
  if(cin--<0) break;
}
}
return 0;
}
